<template>
  <div>
    <el-select
      :value="value + ''"
      @input="$emit('input', $event)"
      v-if="!multiple"
      :placeholder="placeholder"
      :disabled="disabled"
      clearable
      style="width:100%"
    >
      <el-option
        :label="data.dictLabel"
        v-for="data in dataList"
        :key="data.dictValue"
        :value="data.dictValue"
        >{{ data.dictLabel }}</el-option
      >
    </el-select>
    <el-select
     :value="value"
      @input="$emit('input', $event)"
      v-else
      :placeholder="placeholder"
      :disabled="disabled"
      clearable
      :multiple="true"
      :multiple-limit="limit"
      style="width:100%"
    >
      <el-option
        :label="data.dictLabel"
        v-for="data in dataList"
        :key="data.dictValue"
        :value="data.dictValue"
        >{{ data.dictLabel }}</el-option
      >
    </el-select>
  </div>
</template>
<script>
import { getDictDataList } from "@/utils";
export default {
  name: "RenSelect",
  data() {
    return {
      dataList: getDictDataList(this.dictType),
    };
  },
  props: {
    value: [Number, String,Array],
    dictType: String,
    placeholder: String,
    disabled:Boolean,
    multiple:Boolean,
    limit:Number
  },
};
</script>
